<template>
    <div style="background-color: #f4f4f4; height: 100%; position: relative">
 <div>
    <van-sticky>
      <van-nav-bar
        title="不凡"
        left-text="返回"
        left-arrow
        @click-left="onClickLeft"
      />
    </van-sticky>


    <van-address-list
  v-model="chosenAddressId"
  :list="list"
   
  default-tag-text="默认"
  @add="onAdd"
  @edit="onEdit"
/>







 </div>




    </div>
</template>

    <script>
    import {address} from "@/api/my/address/index.js"
    export default {
        data () {
            return {
                chosenAddressId: '1',
                list:[],

            }
        },
        computed:{

        },
        created () {
            address({
      openId: localStorage.getItem("openId"),

            }).then((res)=>{
                console.log(res);
                this.list =res.data
            })
        },
        mounted () {
            
        },
        methods: {
            onClickLeft() {
      this.$router.push({
        name: "my",
      });
    },

    onAdd() {
    //   Toast('新增地址');
    this.$router.push({
        name: "detail",
      });
    },
    onEdit(item, index) {
    //   Toast('编辑地址:' + index);
    },
        }
}
    </script>

    <style scoped lang="scss">

    </style>
